﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace CustomMVC.Extensions
{
    public static class JsonExtensions
    {
        public static string toJson(this object obj)
        {
            return JsonConvert.SerializeObject(obj);
        }

        public static object fromJson<T>(this string json)
        {
            return JsonConvert.DeserializeObject<T>(json);
        }
    }
}
